<?php

namespace App;

use Illuminate\Foundation\Auth\Attr as Authenticatable;
use Illuminate\Database\Eloquent\Model;
class Attr extends Model
{
	public $timestamps = false;
	public $table='attr';
    public function insert_do($arr=array()){
    	return self::insert($arr);
    }
       public function getAll(){
    	return self::where('attr_status',0)->get();
    }
        public function getOne($id){
    	return self::where('attr_id',$id)->get();
    }
        public function updateOne($id,$arr=array()){
        return self::where('attr_id',$id)->update($arr);
    }
    public function getField($id){
		return self::where('attr_id',$id)->update(['attr_status'=>1]);
	}
    public function getSome($id){
        return self::where('type_id',$id)->get();
    }
    public function typeAttr($type_id){
        //return $type_id;
        //return self::where('attr_status',0)->get();
         return self::where('type_id',$type_id)->get();
    }
    public function getLists($data){
        return self::where($data)->select('attr_id','attr_name')->get()->toArray();
    }
}